<template>
  <div class="app-container">
    <div class="filter-container">
      <!-- <el-input style="width: 200px;" class="filter-item" placeholder="请输入设备编号" v-model="queryForm.deviceCode">
      </el-input>
      <el-select clearable style="width: 150px" class="filter-item" v-model="queryForm.operationType" placeholder="请选择操作类型">
        <el-option v-for="(val, key) in Dicts.OPERATION_TYPE" :key="key" :label="val" :value="key"></el-option>
      </el-select>
       <el-date-picker class="filter-item" type="date"  v-model="queryForm.startTime" :picker-options="pickerStartTime" placeholder="选择开始日期"  style="width: 150px;" value-format="yyyy-MM-dd" @change="changeTime"></el-date-picker>
      <label class="filter-item">-</label>
      <el-date-picker class="filter-item" type="date" @change="dateChangebirthday"  v-model="queryForm.endTime" :picker-options="pickerEndTime" placeholder="选择结束日期"  style="width: 150px;" value-format="yyyy-MM-dd"></el-date-picker>
      <el-button class="filter-item" @click="doQuery" type="primary" icon="el-icon-search" >查询</el-button> -->
    </div>
    <el-table v-loading="loading" :data="records" style="width: 100%">
      <el-table-column prop="rowId" label="ID" width="300" align="center">
      </el-table-column>
      <el-table-column prop="type" label="分类" width="300" align="center">
      </el-table-column>
      <el-table-column prop="number" label="数量" width="300" align="center">
      </el-table-column>
      <el-table-column
        prop="beginTime"
        label="开始时间"
        width="400"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="endTime"
        label="结束时间"
        width="400"
        align="center"
      >
      </el-table-column>
    </el-table>
    <div class="pagination-container">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryForm.current"
        :page-sizes="[10, 20, 30, 50]"
        :page-size="queryForm.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="queryForm.total"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import { queryWorkSheetClassify } from '@/api/report'

export default {
  name: 'workSheetClassify',
  data() {
    return {
      loading: false,
      queryForm: {
        current: 1,
        pages: 0,
        total: 0,
        size: 10,
        startTime: '',
        endTime: '',
        operationType: undefined,
        title: undefined
      },
      records: []
    }
  },
  created() {
    this.doQuery()
  },
  methods: {
    handleCurrentChange(current) {
      this.queryForm.current = current
      this.doQuery()
    },
    handleSizeChange(size) {
      this.queryForm.size = size
      this.doQuery()
    },
    doQuery() {
      this.loading = true
      queryWorkSheetClassify(this.queryForm).then(({ data: { data } }) => {
        this.queryForm.current = data.current
        this.queryForm.pages = data.pages
        this.queryForm.total = data.total
        this.queryForm.size = data.size
        this.records = data.records
        this.loading = false
      })
    }
  },
  components: {}
}
</script>

<style scoped></style>
